<div class="announcement main">
  <div class="container-header">
    发布公告
  </div>
  <div class="announcement-content">
    <form name="addForm" novalidate>
      <div class="pa-form-control">
        <label class="fl"><b>*</b>通知单位：</label>
        <div class="reasons fl">
          <button class="sel-btn-primary"
            ng-class="{'active': reason.active ? true : false}"
            ng-click="reason.active = !reason.active"
            ng-repeat="reason in announcement.unit">{{reason.name}}</button>
        </div>
        <span class="error-tip"
          ng-show="announcement.isMandatory">
          必填
        </span>
      </div>
      <div class="pa-form-control">
        <label class="fl"><b>*</b>公告标题：</label>
        <input class="notice-title" type="text" name="noticeTitle" required
          placeholder="请输入公告标题" ng-model="announcement.announcementInfo.title">
        <span class="error-tip"
          ng-show="(addForm.$submitted || addForm.noticeTitle.$dirty) && addForm.noticeTitle.$error.required">
          必填
        </span>
      </div>
      <div class="pa-form-control notice-content-tip">
        <label class="fl"><b>*</b>公告内容：</label>
        <textarea class="notice-title-content" name="noticeContent"
          placeholder="请输入公告内容，1500字以内"
          ng-model="announcement.announcementInfo.context"
          ng-change="announcement.checkText()" required></textarea>
        <span class="beyond-tip" 
          ng-show="announcement.reasonAddition">公告内容不能超过5000个字数</span>
        <span class="error-tip"
          ng-show="(addForm.$submitted || addForm.noticeContent.$dirty) && addForm.noticeContent.$error.required">
          必填
        </span>
      </div>
      <div class="pa-form-control">
        <common-attachment-upload
          component-id="cp2"
          pick-btn-id="avatar_attachment_picker"
          upload-url="{{fileUploadUrl.noticeFile}}"
          file-list="announcement.profilesToken"
          message="announcement.msg"></avatar-attachment-upload>          
      </div>
      <div class="btn-outer">
        <a class="pa-btn"
          authorization-btn="api/securityActivities/specialCheck/addTask"
          ng-click="announcement.save(addForm)">
          <i class="fa fa-save"></i>
          <span class="ml5">确定</span>
        </a>
        <a class="pa-btn reset-btn"
          ui-sref="projectNotice">
          <i class="fa fa-repeat"></i>
          <span class="ml5">取消</span>
        </a>
      </div>     
    </form>
  </div>
</div>